%option noyywrap

%{

#include <stdio.h>

#include <stdlib.h>



#define YY_DECL int yylex()



#include "calc.tab.h"



%}



%%



[ \t]	; // ignore all whitespace

[0-9]+		{yylval.ival = atoi(yytext); return T_INT;}

"+"		{return T_PLUS;}

"-"		{return T_MINUS;}

"*"		{return T_MULT;}

"("		{return T_LEFT;}

")"		{return T_RIGHT;}

"#"		{return T_END;}



%%

